package com.carcenter.sms.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
/**
 * 消息队列的配置类
 */
@Configuration
public class RabbitConfig {

    /**
     * 创建一个邮件队列
     */
    @Bean
    public Queue telQueue() {
        return new Queue("tel.queue");
    }


    /**
     * 消息序列化成JSON字符串
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
